Skip to content

Let Batch.remove_queued_data_rows remove specific data rows - #2101

Merged
Gabefire merged 2 commits into
developfrom
gu/remove-specific-queued-data-rows
Nov 20, 2026
Merged

Gabefire merged 2 commits into
developfrom
gu/remove-specific-queued-data-rows

Conversation

@Gabefire

@Gabefire Gabefire commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

SDK half of per-row queue removal. The API half shipped in Labelbox/intelligence#32037.

Today the only way to take one unlabeled data row out of a project, without deleting it from Catalog, is Batch.remove_queued_data_rows(). That removes every unlabeled row in the batch, so you had to record the batch's other rows, remove them all, and then re-batch them with matching consensus settings. Reported in #C910KT9B4.

Changed

  • Batch.remove_queued_data_rows(data_row_ids=None):
    • Without data_row_ids: unchanged. It sends the same mutation as before.
    • With data_row_ids: only those unlabeled rows leave the batch and the project. They stay in Catalog and in other projects.
    • All or nothing: if any of them is labeled or not in the batch, nothing is removed and OperationNotAllowedException names those rows.
    • Limit: 10,000 ids per call.
  • Before sending a request, it raises ValueError if the list is empty (so [] never means "remove everything"), if a bare string is passed, or if a non-string id is passed.

Labeled rows still have to be cleared first, for example with label.delete() or Delete and requeue in the UI.

Testing

  • New tests/unit/test_unit_batch_remove_queued_data_rows.py (5 tests) passes locally.
  • New integration test test_remove_specific_queued_data_rows in tests/integration/test_batch.py checks three things: one row is removed, the other stays queued, and the removed row is still in Catalog. A second call naming the removed row raises and removes nothing. It runs against staging in CI.
  • ruff format and mypy pass on batch.py.

🤖 Generated with Claude Code


Note

Low Risk
Backward-compatible SDK API extension with client-side validation; queue removal behavior is unchanged when data_row_ids is omitted.

Overview
Extends Batch.remove_queued_data_rows with an optional data_row_ids argument so callers can drop specific unlabeled rows from a batch and the project queue instead of clearing the whole batch. Calling it with no args keeps the previous behavior and GraphQL mutation.

When ids are provided, the client validates the input (non-empty list of strings, copies one-shot iterables) and calls removeQueuedDataRowsFromBatch with dataRowIds. The docstring now documents Catalog retention, the 10k cap, and ValueError / OperationNotAllowedException cases.

Adds unit tests for both code paths and argument validation, plus an integration test that removes one row, leaves the rest queued, and errors on a second call that includes an already-removed id.

Reviewed by Cursor Bugbot for commit bacb559. Bugbot is set up for automated code reviews on this repo. Configure here.

remove_queued_data_rows() takes an optional data_row_ids list. With it, only
those unlabeled rows leave the batch and the project; they stay in Catalog and
other projects. If any of them is labeled or not in the batch, nothing is
removed. Without it, every unlabeled row in the batch is removed, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b5b60f0. Configure here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gabefire
Gabefire merged commit 35db4a4 into develop Nov 20, 2026
15 of 25 checks passed
@Gabefire
Gabefire deleted the gu/remove-specific-queued-data-rows branch November 20, 2026 13:14
@Gabefire Gabefire mentioned this pull request Nov 20, 2026

This branch was previously deployed

1 inactive deployment
Test-PyPI — bacb5595 Deployed Nov 18, 2026 by Gabefire via test-pypi #2581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants